// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 需求添加交易 POST /cq/add/trade */
export async function addTradeUsingPost(body: API.CqTradeInfoVO, options?: { [key: string]: any }) {
  return request<API.TradeResult>('/cq/add/trade', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 需求分配交易 POST /cq/allot/trade */
export async function allotTradeUsingPost(body: API.CqTradeVO, options?: { [key: string]: any }) {
  return request<API.TradeResult>('/cq/allot/trade', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 查询需求详细信息 GET /cq/detail/${param0} */
export async function fetchCqDetailInfoUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.fetchCqDetailInfoUsingGETParams,
  options?: { [key: string]: any },
) {
  const { cqId: param0, ...queryParams } = params;
  return request<API.TradeResult>(`/cq/detail/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 新增需求 POST /cq/insert */
export async function insertCqUsingPost(body: API.CqBaseInfoVO, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/cq/insert', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 分页查询需求列表 POST /cq/list */
export async function listAllCqUsingPost(
  body: API.PageBeanCqListQuery_,
  options?: { [key: string]: any },
) {
  return request<API.TradeResult>('/cq/list', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** fetchTrades GET /cq/trades/${param0} */
export async function fetchTradesUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.fetchTradesUsingGETParams,
  options?: { [key: string]: any },
) {
  const { cqId: param0, ...queryParams } = params;
  return request<API.TradeResult>(`/cq/trades/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 需求更新明细信息 POST /cq/update/detail */
export async function updateCqDetailInfoUsingPost(
  body: API.CqDetailInfoVO,
  options?: { [key: string]: any },
) {
  return request<API.TradeResult>('/cq/update/detail', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 需求更新文档信息 POST /cq/update/doc */
export async function updateCqDocInfoUsingPost(
  body: API.CqDocInfoVO,
  options?: { [key: string]: any },
) {
  return request<API.TradeResult>('/cq/update/doc', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
